package com.simpleframe.security;

import java.util.ArrayList;
import java.util.List;

public abstract class User implements java.io.Serializable{
	//登录后，把用户保存到这里来，再把该对象，保存到Sission
	public static final String USER_SESSION = "currentUser";
	//用户未登录时，记录他来时的地址，用于登录后自动跳转
	public static final String USER_LAST_URL = "user_last_url";
	//登录的用户
//	private Object user;
	
	//角色列表
	private List<Long> roleIds;

//	public Object getUser() {
//		return user;
//	}
//	
//	public void setUser(Object user) {
//		this.user = user;
//	}
	
	//用于登录验证
	public abstract String getPassword();
	public abstract Long getId();
	
	public List<Long> getRoleIds(){
		return roleIds;
	}
	
	public void setRoleIds(List<Long> roleIds) {
		this.roleIds = roleIds;
	}

	public String getRoleName(){
		return "用户角色未输出";
	}

	public void addRoleId(Long id){
		if(roleIds==null){
			roleIds = new ArrayList<Long>();
		}
		roleIds.add(id);
	}
}
